<?php

/**
 * MyProjectNameHere <http://www.example.com>
 * Controller Class
 *
 * It is recommended to extend Controller classes from WWW_Factory in order to 
 * provide various useful functions and API access for the Controller.
 *
 * @package    Factory
 * @author     DeveloperNameHere <email@example.com>
 * @copyright  Copyright (c) 2012, ProjectOwnerNameHere
 * @license    Unrestricted
 * @tutorial   /doc/pages/guide_mvc.htm
 * @since      1.0.0
 * @version    1.0.0
 */

class WWW_controller_state extends WWW_Factory {
	
	/**
	 * Simple example call to get data
	 *
	 * Please note that only public methods can be called through API, protected 
	 * and private methods remain hidden. This method would be accessible over API 
	 * with 'www-command=example-get' call.
	 *
	 * @param array $input input data sent to controller
	 * @input [key] This key is one of the accepted input values
	 * @return array
	 * @output [key] This is an output value that might exist in the output array
	 * @response [500] Data returned
	 */
	public function create(){
		//return $_POST;
		$data=$this->getModel('state');
		$created_info = $data->create();
		return $this->resultTrue('Create state',$created_info);	
	}
	public function update(){		
		$data=$this->getModel('state');
		$updated_info = $data->update();		
		return $this->resultTrue('Update state',$updated_info);		
	}
	public function all(){		
		$data=$this->getModel('state');
		$states_info = $data->all();	
		return $this->resultTrue('All states',$states_info);		
	}
	public function get(){
		$data=$this->getModel('state');
		$state_info = $data->get();	
		return $this->resultTrue('state Info',$state_info);		
	}
	
}
	
?>